﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Text;
using DataAccessLayer;

namespace IndexMarkWcfService
{
    public partial interface IIndexMarkService
    {
        [OperationContract]
        string GetNameBySid(string sid);

        [OperationContract]
        IEnumerable<DTO.AdmJob> GetAdmJobs();

        [OperationContract]
        IEnumerable<DTO.AdmPerson> GetAdmPersons();

        [OperationContract]
        void CopyPersonDegrees(int fromIDTerm, int toIDTerm);

        [OperationContract]
        IEnumerable<DTO.AdmTerm> GetAdmTerms();

        [OperationContract]
        IEnumerable<DTO.AdmPosition> GetAdmPositions();

        [OperationContract]
        IEnumerable<DTO.AdmStatus> GetAdmStatuses();

        [OperationContract]
        IEnumerable<DTO.AdmCategory> GetAdmCategoriesByTerm(int IDTerm);

        [OperationContract]
        IEnumerable<DTO.AdmPersonDegree> GetAdmPersonDegrees(int IDTerm);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmDepartment))]
        [ServiceKnownType(typeof(DTO.AdmDepartmentType))]
        [ServiceKnownType(typeof(DTO.AdmRespondent))]
        IEnumerable<DTO.AdmDepartment> GetUniversityStruct(int IDTerm, bool withRespondents);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmDepartment))]
        [ServiceKnownType(typeof(DTO.AdmDepartmentType))]
        [ServiceKnownType(typeof(DTO.AdmRespondent))]
        IEnumerable<DTO.DTOBase> GetUniversityStructOnDemand(int IDTerm, DTO.AdmDepartment fromDepartment, bool WithRespondents);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmSection))]
        [ServiceKnownType(typeof(DTO.AdmCharacteristic))]
        [ServiceKnownType(typeof(DTO.AdmResponsible))]
        [ServiceKnownType(typeof(DTO.AdmGradation))]
        IEnumerable<DTO.AdmSection> GetIndexMarkStruct(int IDTerm, bool withCharacteristics);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmSection))]
        [ServiceKnownType(typeof(DTO.AdmCharacteristic))]
        [ServiceKnownType(typeof(DTO.AdmResponsible))]
        [ServiceKnownType(typeof(DTO.AdmGradation))]
        IEnumerable<DTO.DTOBase> GetIndexMarkStructOnDemandBySection(int IDTerm, DTO.AdmSection fromSection, bool WithCharacteristics);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmSection))]
        [ServiceKnownType(typeof(DTO.AdmCharacteristic))]
        [ServiceKnownType(typeof(DTO.AdmResponsible))]
        [ServiceKnownType(typeof(DTO.AdmGradation))]
        IEnumerable<DTO.DTOBase> GetIndexMarkStructOnDemandByCharacteristic(int IDTerm, DTO.AdmCharacteristic characteristic);

        [OperationContract]
        IEnumerable<DTO.AdmUnit> GetAdmUnits();

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmGradation))]
        IEnumerable<DTO.AdmGradation> GetGradationsStruct(int IDTerm);

        [OperationContract]
        IEnumerable<DTO.DTOBase> GetGradationsStructOnDemand(int IDTerm, DTO.AdmGradation fromGradation);

        [OperationContract]
        void SaveAdmUnit(IEnumerable<DTO.AdmUnit> list);

        [OperationContract]
        void SaveAdmTerm(IEnumerable<DTO.AdmTerm> list);

        [OperationContract]
        void SaveAdmPerson(IEnumerable<DTO.AdmPerson> list);

        [OperationContract]
        void SaveAdmJob(IEnumerable<DTO.AdmJob> list);

        [OperationContract]
        void SaveAdmStatus(IEnumerable<DTO.AdmStatus> list);

        [OperationContract]
        void SaveAdmPosition(IEnumerable<DTO.AdmPosition> list);

        [OperationContract]
        void SaveAdmCategoriesByTerm(IEnumerable<DTO.AdmCategory> list);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmSection))]
        [ServiceKnownType(typeof(DTO.AdmCharacteristic))]
        [ServiceKnownType(typeof(DTO.AdmGradation))]
        [ServiceKnownType(typeof(DTO.AdmResponsible))]
        void SaveIndexMarkStruct(IEnumerable<DTO.DTOBase> list);

        [OperationContract]
        void CopyIndexMarkStruct(int fromIDTerm, int toIDTerm);

        [OperationContract]
        void CopyUniversityStruct(int fromIDTerm, int toIDTerm);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmDepartment))]
        [ServiceKnownType(typeof(DTO.AdmDepartmentType))]
        [ServiceKnownType(typeof(DTO.AdmRespondent))]
        [ServiceKnownType(typeof(DTO.AdmPerson))]
        [ServiceKnownType(typeof(DTO.AdmJob))]
        void SaveUniversityStruct(IEnumerable<DTO.DTOBase> list);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmSection))]
        [ServiceKnownType(typeof(DTO.AdmCharacteristic))]
        void CopyIndexMarkElement(DTO.DTOBase copiedObject, int toIDTerm, DTO.DTOBase targetObject);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmDepartment))]
        [ServiceKnownType(typeof(DTO.AdmDepartmentType))]
        [ServiceKnownType(typeof(DTO.AdmRespondent))]
        void CopyUniversityElement(DTO.DTOBase copiedObject, int toIDTerm, DTO.DTOBase targetObject);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmGradation))]
        void CopyGradationStructElement(DTO.DTOBase copiedObject, int toIDTerm, DTO.DTOBase targetObject);

        [OperationContract]
        IEnumerable<DTO.AdmResponsible> GetAdmResponsibles();

        [OperationContract]
        void SaveAdmResponsible(IEnumerable<DTO.AdmResponsible> list);

        [OperationContract]
        IEnumerable<DTO.AdmCharacteristic> GetAdmCharacteristics();
        [OperationContract]
        void SaveAdmCharacteristic(IEnumerable<DTO.AdmCharacteristic> list);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmDepartmentType))]
        [ServiceKnownType(typeof(AdmDepartmentSortMode))]
        IEnumerable<DTO.AdmDepartment> GetAdmDepartments(AdmDepartmentSortMode sortMode);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmDepartmentType))]
        void SaveAdmDepartment(IEnumerable<DTO.AdmDepartment> list);

        [OperationContract]
        IEnumerable<DTO.AdmSection> GetAdmSections();
        [OperationContract]
        void SaveAdmSection(IEnumerable<DTO.AdmSection> list);

        [OperationContract]
        IEnumerable<DTO.AdmGradation> GetAdmGradations();

        [OperationContract]
        void SaveAdmGradation(IEnumerable<DTO.AdmGradation> list);

        [OperationContract]
        void SaveAdmPersonDegrees(IEnumerable<DTO.AdmPersonDegree> list);

        [OperationContract]
        IEnumerable<DTO.AdmCategory> GetAdmCategories();
        [OperationContract]
        void SaveAdmCategory(IEnumerable<DTO.AdmCategory> list);

        [OperationContract]
        void CopyAdmCategoriesByTerm(int fromIDTerm, int toIDTerm);

        // AsnwerLog
        [OperationContract]
        [ServiceKnownType(typeof(DTO.FilterAnswerLogAttributes))]
        [ServiceKnownType(typeof(DTO.StateObject))]
        IEnumerable<DTO.AdmAnswerLog> GetAnswerLog(DateTime fromDate, DateTime toDate, List<DTO.FilterItem> filters,
            bool onlySubscribers);

        [OperationContract]
        IEnumerable<DTO.AdmAnswerLog> GetAnswerLogDetails(int IDAnswer);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.FilterAnswerLogAttributes))]
        IEnumerable<DTO.AdmAnswerLog> GetAnswerLogTop();

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmAnswerLog))]
        [ServiceKnownType(typeof(DTO.AdmGradationAnswerLog))]
        void SaveAnswerLog(IEnumerable<DTO.DTOBase> list);

        [OperationContract]
        void ClearAnswerLog();
        // ---

        // InputLog
        [OperationContract]
        [ServiceKnownType(typeof(DTO.FilterInputLogAttributes))]
        IEnumerable<DTO.AdmInputLog> GetInputLog(DateTime fromDate, DateTime toDate, List<DTO.FilterItem> filters);

        [OperationContract]
        [ServiceKnownType(typeof(DTO.FilterInputLogAttributes))]
        IEnumerable<DTO.AdmInputLog> GetInputLogTop();

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmInputLog))]
        void SaveInputLog(IEnumerable<DTO.DTOBase> list);

        [OperationContract]
        void ClearInputLog();
        // ---

        [OperationContract]
        [ServiceKnownType(typeof(DTO.AdmGradation))]
        void SaveAdmGradationHierarhial(IEnumerable<DTO.DTOBase> list);

        [OperationContract]
        IEnumerable<DTO.AdmDepartmentType> GetAdmDepartmentTypes();

        [OperationContract]
        void SaveAdmDepartmentTypes(IEnumerable<DTO.AdmDepartmentType> list);

        [OperationContract]
        void SaveAdmDegree(IEnumerable<DTO.AdmDegree> list);

        [OperationContract]
        IEnumerable<DTO.AdmDegree> GetAdmDegrees();

        [OperationContract]
        DTO.SubscriberState CheckSubscribe(string SID);

        [OperationContract]
        DTO.SubscriberInfo GetSubscriberInfo(string SID);

        [OperationContract]
        void SaveSubscriberInfo(DTO.SubscriberInfo subscriberInfo);

        [OperationContract]
        IEnumerable<DTO.SubscriberInfo> GetAllActivitySubscribers(DateTime fromDate, DateTime toDate);
    }
}